from django.shortcuts import render
from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
# Create your views here.
#重新父类用于判断用户是否登录

class LoginRequiredJsonMixin(LoginRequiredMixin):
    #重新父类中用户未登录时的响应
    def handle_no_permission(self):
        return http.JsonResponse({'code': 400,
                                  'errmsg': '用户未登录'})